A web content optimization server is a proxy server that optimizes web page interactions for client devices with special requirements, such as mobile phones, PDAs, and smartphones and for browsing tools used by visitors with special needs, such as visual impaired users. By way of example, a web content optimization server optimizes web page interactions as follows. A client device sends an HTTP request for a web page. The web content optimization server downloads the requested original web page from the content server listed in the received request. Next, the web content optimization server optimizes the content of the web page by applying transformation rules tailored to the requesting client device. This optimization process includes extracting the content relevant to the requesting client device and adapting this extracted content to fit the specifications of the requesting client device. By way of example, these transformations include JavaScript removal, content linearization, and small screen adaptation.
Although this process works well to optimize content for display at the requesting client device, the optimization process may fail when the original content heavily depends on JavaScript technology. For example, if the requested web page includes a JavaScript code or instruction set responsible for populating form fields, validating form submissions, retrieving data from external resources (based on AJAX technology), and even generating components that may change the structure of the web page, the page at the client device will not be able to properly function.
One example of how a JavaScript instruction set operates in a web page is illustrated with reference to FIGS. 2-4. Referring more specifically to FIG. 2, an exemplary web page of a login form 100 used to gain access to a web site is illustrated. To execute the login process, a user must enter the correct a user identification into the user id field 102 and a password in the illustrated password field 104 and then click on the login button 106 to submit the login inquiry. The specific action of clicking or otherwise engaging the login button 106 triggers the execution of the JavaScript validateLogin( ) function or instruction set illustrated in FIG. 3. This JavaScript validateLogin( ) function is responsible for validating that the user id field 102 and the password field 104 were properly filled before transmitting to the web content server for the requested web site.
Referring to FIG. 4, a scenario where the user entered the value “John” into the user id field 102, but did not enter any value into the password field 104 is illustrated. When the login button 106 is clicked or otherwise engaged, the validateLogin( ) function generates an error and provides the message “Password cannot be empty” to the HTML element of the displayed web page 100 whose attribute id has the value “error”. When the validateFunction( ) generates an error the data entered by the user is not sent to the web content server for the requested web site.
If, by way of example, an existing web content optimization server optimizes the content of the web page 100 illustrated in FIGS. 2 and 4 by applying transformation rules to remove the JavaScript programmed instruction set that processes any values entered in user id field 102 and password field 104 and initiates an evaluation of entered values when login button 106 is clicked, any values entered could not be processed. Additionally, any attempt to click or otherwise engage the login button 106 would not provide the desired login functionality. As a result, the web page would have been optimized for viewing on the client device, but with substantially reduced functionality.